<?php
/*	===========================================================================
		Правила для операций над многими элементами
	===========================================================================
*/
$many = array(
	new $pattern ($self, array(
	  '(:base_url)/(:path)$', 					
		'module'   => 'Node', 'action' => 'GetTopMenuSettings',
		'path' => 'get_top_menu_settings',
	  )),

	new $pattern ($self, array(
	  '(:base_url)/(:path)$', 					
		'module'   => 'Node', 'action' => 'SaveTopMenu',
		'path' => 'save_top_menu',
	  )),

	new $pattern ($self, array(
	  '(:base_url)/(:path)$', 					
		'module'   => 'Node', 'action' => 'ShowNodeMembers',
		'path' => 'members',
	  )),


	new $pattern ($self, array(
		'(:base_url)(:slash)$',
		'module'   => 'Node',
		'action' => 'ShowHp',
		'slash' => '[//]*',
		//'community_url' => '[a-zA-Z/-]+',
	  )),

	new $pattern ($self, array(
		'(:base_url)/(:path)$',
		'module'   => 'Node',
		'action' => 'ShowAllCommunities',
		'path' => 'allcommunities',
	  )),

	new $pattern ($self, array(
		'(:base_url)/(:path)$',
		'module'   => 'Node',
		'action' => 'CommunitiesCatalog',
		'path' => 'community_cat',
	  )),

	"community_cat_ajax"=>new $pattern ($self, array(
		'(:base_url)/(:path)/(:ajax)$',
		'module'   => 'Node',
		'action' => 'CommunitiesCatalog',
		'path' => 'community_cat',
		'ajax' => 'ajax',
		'is_ajax' => 1,

	  )),

	/*
	// опасная для продакшен инсталляции вещь
	new $pattern ($self, array(
	  '(:base_url)/(:path)$', 		'module'   => 'Community', 'action' => 'Identity',
		'path' => 'identity',
	  )),
	*/

	new $pattern ($self, array(
	  '(:base_url)/(:path)$', 		'module'   => 'Node', 'action' => 'ShowFeed',
		'path' => 'showfeed',
	  )),

	'rss_node' => new $pattern ($self, array(
	  '(:base_url)/(:xml)$', 		'module'   => 'Node', 'action' => 'ShowFeedRss',
		'view' => 'feed_site/rss.xml',
		'xml' => 'feed.xml'
	  )),

	'site_showfeed' => new $pattern ($self, array(
	  '(:base_url)/(:path)/(:ajax)$', 		'module'   => 'Node', 'action' => 'ShowFeed',
		'path' => 'showfeed',
		'ajax' => 'ajax',
		'is_ajax' => 1,
	  )),
	'rss_community_comments' => new $pattern ($self, array(
		'(:base_url)/(:community_url)/(:xml)$',   'module'   => 'Community', 'action' => 'ShowCommentsRss',
		'view' => 'comments/rss.xml',
		'xml' => 'comments.xml'
	  )),
	'rss_community_tdi_comments' => new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:tdi_url)/(:xml)$', 		'module'   => 'Community', 'action' => 'ShowCommentsRss',
		'view' => 'comments/rss.xml',
		'xml' => 'comments.xml'
	  )),
	new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:tdi_url)/(:path)$', 		'module'   => 'Community', 'action' => 'ShowForum',
		'path' => 'showforum',
	  )),
	"showforum_tdi_ajax"=>new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:tdi_url)/(:path)/(:ajax)$', 		'module'   => 'Community', 'action' => 'ShowForum',
		'path' => 'showforum',
		'ajax' => 'ajax',
		'is_ajax' => 1,
	  )),
	new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:path)$', 					'module'   => 'Community', 'action' => 'ShowForum',
		'path' => 'showforum',
	  )),
	"showforum_ajax"=>new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:path)/(:ajax)$', 		'module'   => 'Community', 'action' => 'ShowForum',
		'path' => 'showforum',
		'ajax' => 'ajax',
		'is_ajax' => 1,
	  )),
	new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:path)$', 					'module'   => 'Community', 'action' => 'ShowForum',
		'path' => 'showforum',
	  )),
	new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:path)/(:ajax)$', 		'module'   => 'Community', 'action' => 'AjaxComMembers',
		'path' => 'members',
		'ajax' => 'ajax',
		'is_ajax' => 1,
	  )),
	'community_show_users' => new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:path)$', 					'module'   => 'Community', 'action' => 'ShowComMembers',
		'path' => 'members',
	  )),
	'community_join_queue' => new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:path)$', 					'module'   => 'Community', 'action' => 'ShowJoinQueue',
		'path' => 'joinqueue',
	  )),
	'community_join_queue_ajax' => new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:path)/(:ajax)$', 					'module'   => 'Community', 'action' => 'ShowJoinQueue',
		'path' => 'joinqueue',
		'ajax' => 'ajax',
		'is_ajax' => 1,
	  )),
	"showfeed_tdi"=>new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:tdi_url)/(:path)$', 		'module'   => 'Community', 'action' => 'ShowFeed',
		'path' => 'showfeed',
	  )),
	"showfeed_tdi_ajax"=>new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:tdi_url)/(:path)/(:ajax)$', 		'module'   => 'Community', 'action' => 'ShowFeed',
		'path' => 'showfeed',
		'ajax' => 'ajax',
		'is_ajax' => 1,
	  )),
	'rss_community_tdi_feed' => new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:tdi_url)/(:xml)$', 		'module'   => 'Community', 'action' => 'ShowFeedRss',
		'view' => 'feed/rss.xml',
		'xml' => 'feed.xml'
	  )),
	"showfeed"=>new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:path)$', 					'module'   => 'Community', 'action' => 'ShowFeed',
		'path' => 'showfeed',
	  )),
	"showfeed_ajax"=>new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:path)/(:ajax)$', 		'module'   => 'Community', 'action' => 'ShowFeed',
		'path' => 'showfeed',
		'ajax' => 'ajax',
		'is_ajax' => 1,
	  )),
	'rss_community_feed' => new $pattern ($self, array(
	  '(:base_url)/(:community_url)/(:xml)$', 		'module'   => 'Community', 'action' => 'ShowFeedRss',
		'view' => 'feed/rss.xml',
		'xml' => 'feed.xml'
	  )),
	new $pattern ($self, array(
		'(:base_url)/(:community_url)/(:path)$',
		'module' => 'Community',
		'action' => 'ShowAlphabet',
		'path' => 'showalphabet',
	  )),
	new $pattern ($self, array(
		'(:base_url)/(:community_url)/(:tdi_url)/(:path)$',
		'module'   => 'Community',
		'action' => 'ShowAlphabet',
		'path' => 'showalphabet',
	  )),
	new $pattern ($self, array(
		'(:base_url)/(:community_url)/(:tdi_url)/(:path)$',
		'module'   => 'Community',
		'action' => 'ShowIssues',
		'path' => 'showissues',
	  )),
	"showfiles_ajax"=>new $pattern ($self, array(
		'(:base_url)/(:community_url)/(:path)/(:ajax)$',
		'module' => 'Community',
		'action' => 'ShowFiles',
		'path' => 'showfiles',
		'is_ajax' => 1,
	  )),
	"showfiles_tdi_ajax"=>new $pattern ($self, array(
		'(:base_url)/(:community_url)/(:tdi_url)/(:path)/(:ajax)$',
		'module'   => 'Community',
		'action' => 'ShowFiles',
		'path' => 'showfiles',
		'is_ajax' => 1,
	  )),
	new $pattern ($self, array(
		'(:base_url)/(:community_url)/(:path)$',
		'module' => 'Community',
		'action' => 'ShowFiles',
		'path' => 'showfiles',
	  )),
	new $pattern ($self, array(
		'(:base_url)/(:community_url)/(:tdi_url)/(:path)$',
		'module'   => 'Community',
		'action' => 'ShowFiles',
		'path' => 'showfiles',
	  )),
	new $pattern ($self, array(
		'(:base_url)/(:community_url)/(:path)$',
		'module' => 'Community',
		'action' => 'ShowGallery',
		'path' => 'showgallery',
	  )),
	new $pattern ($self, array(
		'(:base_url)/(:community_url)/(:tdi_url)/(:path)$',
		'module'   => 'Community',
		'action' => 'ShowGallery',
		'path' => 'showgallery',
	  )),
	"showgallery_ajax"=>new $pattern ($self, array(
		'(:base_url)/(:community_url)/(:path)/(:ajax)$',
		'module' => 'Community',
		'action' => 'ShowGallery',
		'path' => 'showgallery',
		'is_ajax' => 1,
	  )),
	"showgallery_tdi_ajax"=>new $pattern ($self, array(
		'(:base_url)/(:community_url)/(:tdi_url)/(:path)/(:ajax)$',
		'module'   => 'Community',
		'action' => 'ShowGallery',
		'path' => 'showgallery',
		'is_ajax' => 1
	  )),

	// FIXME : 2008-01-22 : lucky
	// загружает tdi и определяет из настроек view раздела по-умолчанию
	// затем, используя "view->action map" определяет экшен.
	//
	// "тяжелый". выполнят запросы к БД.

	'community_tdi' => new RL_RequestRouter_Community($self, $rh->ctx->store, array(
	  '(:base_url)/(:community_url)/(:tdi_url)/?$', 		'module'   => 'Community',
		), array( // view -> action map
			'showfeed'    => 'ShowFeed',
			'showissues'  => 'ShowIssues',
			'showforum'   => 'ShowForum',
			'showgallery' => 'ShowGallery',
			'showfiles'   => 'ShowFiles',
			'showalphabet'=> 'ShowAlphabet',
		)),

	/*
	new RL_RequestRouter_Community($self, array(
	  '(:base_url)/(:community_url)/?$', 		'module'   => 'Community',
	  )),
	 */

	new $pattern ($self, array(
		'(:base_url)/(:community_url)/(:id_item)/(:xml)$',   'module'   => 'Community', 'action' => 'ShowCommentsRss',
		'id_item' => '[0-9]+',
		'view' => 'comments/rss.xml',
		'xml' => 'comments.xml'
	  )),

/*
	new $pattern ($self, array(
	  '(:base_url)/(:path)/(:entry)$',             'module'   => 'generic', 'action' => 'static',
	                                              'path' => 'images',
	                                              'entry' => '.*',
	                                              'document_root' => $self->ctx->tpl->tpl_root_dir . 'images/',
	                                              'show_indexes' => True,
	)),
	new $pattern ($self, array(
	  '(:base_url)/(:path)/(:entry)$',             'module'   => 'generic', 'action' => 'static',
	                                              'path' => 'tmp',
	                                              'entry' => '.*',
	                                              'document_root' => $self->ctx->tpl->tpl_root_dir . 'tmp/',
	)),
	new $pattern ($self, array(
	  '(:base_url)/(:path)/(:entry)$',              'module'   => 'generic', 'action' => 'static',
	                                              'path' => 'css',
	                                              'entry' => '.*',
	                                              'document_root' => $self->ctx->tpl->tpl_root_dir . 'css/',
	)),
	new $pattern ($self, array(
	  '(:base_url)/(:path)/(:entry)$',              'module'   => 'generic', 'action' => 'static',
	                                              'path' => 'js',
	                                              'entry' => '.*',
	                                              'document_root' => $self->ctx->tpl->tpl_root_dir . 'js/',
	)),
*/

);
